/*
 * main.cpp
 *
 *  Created on: 03/06/2014
 *      Author: jubuntu
 */



#include <iostream>
#include <time.h>
#include "Compresor.h"

const std::string currentDateTime(){
	time_t now = time(0);
	struct tm tstruct;
	char buf[80];
	tstruct = *localtime(&now);
	strftime(buf,sizeof(buf),"%Y-%m-%d.%X",&tstruct);

	return buf;
}

int main(int argc, char* argv[]){

	std::cout<<"Tiempo de inicio: " << currentDateTime()<<std::endl;
	Compresor* miCompresor = new Compresor(argv[2], argv[3]); //argv[2], argv[3]);
	if(*argv[1] == 'c'){
		std::cout << "Empezando la compresion..." << std::endl;
		miCompresor->comprimirArchivo();
	}
	if(*argv[1] == 'd'){
		//DESCOMPRIMIR
	}

	std::cout<<"Tiempo de finalizado: " << currentDateTime()<<std::endl;

	delete miCompresor;
	return 0;
}
